package com.ld.data.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    public static final String YYYYMMDD = "yyyyMMdd";

    public static Long currentTimeMillis() {
        return System.currentTimeMillis();
    }

    /**
     * 将日期转换成指定日期格式
     * @param date
     * @param pattern
     * @return
     */
    public static String dateToStr(Date date, String pattern) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
        String formatDateStr = dateFormat.format(date);
        return formatDateStr;
    }

}
